package WeightBalancedTree;

public class Node {
	
	@SuppressWarnings("rawtypes")
	private Comparable key;
	private int chance;
	private Node left;
	private Node right;
	
	@SuppressWarnings("rawtypes") 
	public Node(Comparable o, int chance){
		
		this.key=o;
		this.chance=chance;
		left=null;
		right=null;
	}
	
	@SuppressWarnings("rawtypes")
	public Comparable getObject(){
		return key;
	}
	
	public int getChance(){
		return chance;
	}
	
	public Node getLeft(){
		return left;
	}
	
	public Node getRight(){
		return right;
	}
	
	public void setLeft(Node n){
		left=n;
	}
	
	public void setRight(Node n){
		right=n;
	}
	
	public String toString(){
		StringBuffer sb =new StringBuffer();
		return sb.append(key.toString()).append(" ").append(chance).append(" ").toString();
	}

}
